
 package com.ami.kvm.jviewer.gui;
 
 import com.ami.kvm.jviewer.JViewer;
 import com.ami.kvm.jviewer.videorecord.DisplayVideoDataTask;
 import com.ami.kvm.jviewer.videorecord.VideoRecordApp;
 import java.awt.Dimension;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JSlider;
 import javax.swing.JToolBar;
 import javax.swing.border.EtchedBorder;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 public class RecorderToolBar
   extends JVToolBar
   implements MouseListener
 {
   private JToolBar m_recToolbar;
   private int counter = 0;
   public JButton replayButton;
   public static final String PAUSE = "PAUSE";
   public static final String PLAY = "PLAY";
   private static JSlider slider;
   private static JPanel panel;
   private static JLabel label;
   
   public RecorderToolBar() { this.m_recToolbar = new JToolBar();
     panel = new JPanel();
     label = new JLabel("0");
     slider = new JSlider(0, 200);
     slider.setEnabled(false);
     Dimension localDimension = slider.getPreferredSize();
     slider.setPreferredSize(new Dimension(localDimension.width + 500, localDimension.height));
     slider.setMajorTickSpacing(20);
     slider.setVisible(false);
     label.setVisible(false);
     panel.add(slider);
     panel.add(label);
     panel.setVisible(false);
     this.replayButton = createButton("res/pause.png", LocaleStrings.getString("R_2_RT"), 33, 33, 33, 33);
     
 
     this.m_recToolbar.add(this.replayButton);
     
     EtchedBorder localEtchedBorder = new EtchedBorder(1);
     this.m_recToolbar.setBorder(localEtchedBorder);
     this.m_recToolbar.setFloatable(false);
     this.m_recToolbar.repaint();
   }
   
   public JToolBar getToolBar() { return this.m_recToolbar; }
   
 
   public void mouseClicked(MouseEvent paramMouseEvent) {}
   
 
   public void mouseEntered(MouseEvent paramMouseEvent) {}
   
 
   public void mouseExited(MouseEvent paramMouseEvent) {}
   
   public void mousePressed(MouseEvent paramMouseEvent)
   {
     if (this.replayButton.getActionCommand().equals("PAUSE")) {
       if ((DisplayVideoDataTask.getVideoDuration() != 0) && (JViewer.isplayerapp())) {
         this.counter = DisplayVideoDataTask.getCounter();
         DisplayVideoDataTask.pause();
       }
       this.replayButton.setIcon(new ImageIcon(JViewer.class.getResource("res/play.png")));
       this.replayButton.setToolTipText(LocaleStrings.getString("R_1_RT"));
       this.replayButton.setActionCommand("PLAY");
       DisplayVideoDataTask.setPaused(true);
     } else if (this.replayButton.getActionCommand().equals("PLAY")) {
       if ((DisplayVideoDataTask.getVideoDuration() != 0) && (JViewer.isplayerapp())) {
         DisplayVideoDataTask.resume();
         DisplayVideoDataTask.setCounter(this.counter);
       }
       this.replayButton.setIcon(new ImageIcon(JViewer.class.getResource("res/pause.png")));
       this.replayButton.setToolTipText(LocaleStrings.getString("R_2_RT"));
       this.replayButton.setActionCommand("PAUSE");
       synchronized (DisplayVideoDataTask.getPlayLock()) {
         DisplayVideoDataTask.setPaused(false);
         DisplayVideoDataTask.getPlayLock().notifyAll();
       }
     } else {
       JViewerApp.getInstance().getVideorecordapp().OnVideorecordStartRedirection();
     }
   }
   
 
   public void mouseReleased(MouseEvent paramMouseEvent) {}
   
 
   public void disableButton(JButton paramJButton)
   {
     paramJButton.setEnabled(false);
     paramJButton.removeMouseListener(this);
   }
   
 
 
   public void enableButton(JButton paramJButton)
   {
     paramJButton.setEnabled(true);
     paramJButton.addMouseListener(this);
   }
   
 
   public static JPanel getPanel()
   {
     return panel;
   }
   
 
   public static JLabel getLabel()
   {
     return label;
   }
   
 
   public static void setLabel(JLabel paramJLabel)
   {
     label = paramJLabel;
   }
   
 
   public static JSlider getSlider()
   {
     return slider;
   }
   
 
   public static void setSlider(JSlider paramJSlider)
   {
     slider = paramJSlider;
   }
   
   public static void updateComponents(int paramInt) {
     label.setVisible(true);
     slider.setVisible(true);
     panel.setVisible(true);
     slider.setMaximum(paramInt * 10);
   }
 }


/* Location:              D:\Users\tianlin\Downloads\JViewer.jar!\com\ami\kvm\jviewer\gui\RecorderToolBar.class
 * Java compiler version: 5 (49.0)
 * JD-Core Version:       0.7.1
 */